package com.domain;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Objects;

public class User {
    private String username;
    private String password;
    private String email;
    private LocalDateTime freezeTime;
    private HashMap<String, LocalDateTime> log;

    public User(String username, String password, String email, LocalDateTime freezeTime, HashMap<String, LocalDateTime> log) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.freezeTime = freezeTime;
        this.log = log;
    }

    public User() {
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public HashMap<String, LocalDateTime> getLog() {
        return log;
    }

    public void setLog(HashMap<String, LocalDateTime> log) {
        this.log = log;
    }


    public LocalDateTime getFreezeTime() {
        return freezeTime;
    }

    public void setFreezeTime(LocalDateTime freezeTime) {
        this.freezeTime = freezeTime;
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", freezeTime=" + freezeTime +
                ", log=" + log +
                '}';
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(username, user.username) &&
                Objects.equals(password, user.password) &&
                Objects.equals(email, user.email) &&
                Objects.equals(freezeTime, user.freezeTime) &&
                Objects.equals(log, user.log);
    }

    @Override
    public int hashCode() {
        return Objects.hash(username, password, email, freezeTime, log);
    }
}
